var express = require('express');
var router = express.Router();
const dataCtrl = require('../controllers/order.controller');

/* GET users listing. */
router.get('/', function(req, res, next) {
    res.send("<h1>欢迎来到我们项目</h1><h4>我们的组员有：黄安、罗元伟、曹勇、姜亚庆、刘雪、李强、戚活跃</h4>");
});

//rest api get/post/put/delete
router.post('/data', dataCtrl.create);
router.get('/data/:id', dataCtrl.getdata);
router.put('/data/:id', dataCtrl.update);
router.delete('/data/:id', dataCtrl.remove);
router.post('/list', dataCtrl.list);
router.post('/data/removes', dataCtrl.removes);

module.exports = router;